package com.os;

/**
 * @Author Matt
 * @Date 2022-09-02
 * @Desc:
 * @Version V1.0
 */
public class FlyableDemo {
    public static void main(String[] args) {
        //匿名内部类
        useFlyable(new Flyable() {
            @Override
            public void fly(String s) {
                System.out.println(s);
                System.out.println("飞机可以起飞~");
            }
        });
        System.out.println("--------------------");
        useFlyable((String s) -> {
            System.out.println(s);
            System.out.println("lambda飞机可以起飞~");
        });
    }

    private static void useFlyable(Flyable flyable){
        flyable.fly("风和日丽，晴空万里");
    }
}
